package com.picture.download.controller;

import com.picture.download.Settings;
import com.picture.download.entity.Images;
import org.nutz.dao.Dao;
import org.nutz.lang.random.R;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;

import java.util.Date;

/**
 * Created by chenjidong on 2015/4/22.
 */

@At("/test")
public class Test {

    private Dao dao = Settings.getDao();

    @At("/get")
    @Ok("jsp:jsp.hello")
    public Object get() {
        Images img = new Images();
        img.setOid(R.UU64());
        img.setName("test2");
        img.setCreatedOn(new Date());
        dao.insert(img);
        return "true";
    }
}
